home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / architecture / zs85C30.h < prev   
Text File  |  1992-11-03  |  9KB  |  223 lines

  1. /* Copyright (c) 1992 NeXT Computer, Inc.  All rights reserved.
  2.  *
  3.  *    Zilog Z85C30 Serial Controller Chip definitions
  4.  *
  5.  * The 85C30 contains the following registers:
  6.  * Read Register:    Function:
  7.  *     RR0        Transmit/Receive buffer and external status
  8.  *     RR1        Special receive condition status
  9.  *     RR2        Interrupt vector.
  10.  *     RR3        Interrupt pending bits.
  11.  *     RR8        Receive buffer.
  12.  *     RR10        Miscellaneous status
  13.  *     RR12        Lower byte of baud rate generator time constant
  14.  *     RR13        Upper byte of baud rate generator time constant
  15.  *     RR15        External/Status interrupt information
  16.  *
  17.  * Write register:    Function:
  18.  *    WR0        Initialization commands.
  19.  *    WR1        Transmit/Receive interrupt and data transfer mode
  20.  *    WR2        Interrupt vector
  21.  *    WR3        Receive parameters and control
  22.  *    WR4        Transmit/Receive miscellaneous parameters and modes
  23.  *    WR5        Transmit parameters and controls
  24.  *    WR6        Sync characters or SDLC address field
  25.  *    WR7        Sync character or SDLC flag
  26.  *    WR8        Transmit buffer
  27.  *    WR9        Master interrupt control and reset
  28.  *    WR10        Miscellaneous transmitter/receiver control bits
  29.  *    WR11        Clock mode control
  30.  *    WR12        Lower byte of baud rate generator time constant
  31.  *    WR13        Upper byte of baud rate generator time constant
  32.  *    WR14        Miscellaneous control bits
  33.  *    WR15        External/Status interrupt control
  34.  */
  35.  
  36. /* Read register 0 */
  37. #define RR0_RXAVAIL    0x01        /* Rx Character Available */
  38. #define RR0_ZERO_COUNT    0x02        /* Zero count (timer) */
  39. #define RR0_TXEMPTY    0x04        /* Tx Buffer Empty */
  40. #define RR0_DCD        0x08        /* DCD status */
  41. #define RR0_SYNC_HUNT    0x10        /* Sync hunt mode */
  42.  
  43. /*
  44.  * NOTE: the sense of CTS is dependent on the cpu board rev
  45.  */
  46. #define RR0_CTS        0x20        /* CTS status */
  47.  
  48. #define RR0_TXUNDER    0x40        /* Tx Underrun/EOM */
  49. #define RR0_BREAK    0x80        /* Break/Abort */
  50.  
  51. /* Read register 1 */
  52. #define RR1_ALLSENT    0x01        /* All Sent */
  53. #define RR1_RESCODE2    0x02        /* Residue Code 2 */
  54. #define RR1_RESCODE1    0x04        /* Residue Code 1 */
  55. #define RR1_RESCODE0    0x08        /* Residue Code 0 */
  56. #define RR1_PARITY    0x10        /* Parity Error */
  57. #define RR1_RXOVER    0x20        /* Rx Overrun Error */
  58. #define RR1_FRAME    0x40        /* CRC/Framing Error */
  59. #define RR1_EOF        0x80        /* End of Frame (SDLC) */
  60.  
  61. /*
  62.  * Read/Write Register 2: 8 bits of interrupt vector
  63.  * Channel A unmodified, channel B is modified by current UART status
  64.  */
  65.  
  66. /* Read register 3 -- ONLY CHANNEL A */
  67. #define RR3_B_STATIP    0x01        /* Chanel B Ext/Status intr pending */
  68. #define RR3_B_TXIP    0x02        /* Chanel B Tx interrupt pending */
  69. #define RR3_B_RXIP    0x04        /* Chanel B Rx interrupt pending */
  70. #define RR3_A_STATIP    0x08        /* Chanel A Ext/Status intr pending */
  71. #define RR3_A_TXIP    0x10        /* Chanel A Tx interrupt pending */
  72. #define RR3_A_RXIP    0x20        /* Chanel A Rx interrupt pending */
  73.  
  74. #define    RR3_A_IP    (RR3_A_STATIP|RR3_A_TXIP|RR3_A_RXIP)
  75. #define    RR3_B_IP    (RR3_B_STATIP|RR3_B_TXIP|RR3_B_RXIP)
  76.  
  77. /*
  78.  * Read Register 8: same as data port (receive buffer)
  79.  */
  80.  
  81. /* Read Register 10 */
  82. #define RR10_ONLOOP    0x02        /* On Loop */
  83. #define RR10_LOOPSEND    0x10        /* Loop Sending */
  84. #define RR10_MISS2    0x40        /* Two Clocks Missing */
  85. #define RR10_MISS1    0x80        /* One Clock Missing */
  86.  
  87. /*
  88.  * Read/Write Register 12/13 16 bits of time constant
  89.  */
  90.  
  91. /* Read/Write Register 15 */
  92. #define RW15_ZEROCNTIE    0x02        /* Enable interrupt on timer zero */
  93. #define RW15_DCDIE    0x08        /* Enable interrupt on DCD change */
  94. #define RW15_SYNCIE    0x10        /* Enable interrupt on Sync Hunt */
  95. #define RW15_CTSIE    0x20        /* Enable interrupt on CTS change */
  96. #define RW15_TXUNDERIE    0x40        /* Enable interrupt on TxUnderrun/EOM*/
  97. #define RW15_BREAKIE    0x80        /* Enable interrupt on Break/Abort */
  98.  
  99. /* Write register 0 */
  100. #define WR0_REGMASK    0x0F        /* Mask for register select */
  101. #define WR0_RESET_STAT    0x10        /* Reset Ext/Status Interrupts */
  102. #define WR0_ABORT    0x18        /* Send abort */
  103. #define WR0_NEXTRXIE    0x20        /* Enable interrupt on next char Rx */
  104. #define WR0_RESETTXPEND    0x28        /* Reset Pending Tx Interrupt */
  105. #define WR0_RESET    0x30        /* Error Reset */
  106. #define WR0_RESETIUS    0x38        /* Reset Interrupt Under Service */
  107. #define WR0_RESETRXCRC    0x40        /* Reset Rx CRC Checker */
  108. #define WR0_RESETTXCRC    0x80        /* Reset Rx CRC Generator */
  109. #define WR0_RESETEOM    0xC0        /* Reset Underrun/EOM latch */
  110.  
  111. /* Write register 1 */
  112. #define WR1_EXTIE    0x01        /* External Interrupt Enable */
  113. #define WR1_TXIE    0x02        /* Transmit Interrupt Enable */
  114. #define WR1_PARSPEC    0x04        /* Parity is Special Condition */
  115. #define WR1_RXFIRSTIE    0x08        /* Interrupt Enable on First Rx */
  116. #define WR1_RXALLIE    0x10        /* Interrupt Enable on ALL Rx */
  117. #define WR1_SPECIE    0x18        /* Interrupt on Special only */
  118. #define WR1_REQRX    0x20        /* Request on Rx (else Tx) */
  119. #define WR1_REQFUNC    0x40        /* DMA Request (else cpu wait) */
  120. #define WR1_REQENABLE    0x80        /* Request/Wait enable */
  121.  
  122. /* Read/Write register 2, interrupt vector */
  123.  
  124. /* Write register 3 */
  125. #define WR3_RXENABLE    0x01        /* Rx Enable */
  126. #define WR3_SYNCINHIB    0x02        /* Sync Character Load Inhibit */
  127. #define WR3_ADDRSRCH    0x04        /* Address search mode (SDLC) */
  128. #define WR3_RXCRCENABLE    0x08        /* Rx CRC enable */
  129. #define WR3_ENTERHUNT    0x10        /* Enter Hunt Mode */
  130. #define WR3_AUTOENABLES    0x20        /* Auto Enables */
  131. #define WR3_RX5        0x00        /* Rx 5 bit characters */
  132. #define WR3_RX7        0x40        /* Rx 7 bit characters */
  133. #define WR3_RX6        0x80        /* Rx 6 bit characters */
  134. #define WR3_RX8        0xC0        /* Rx 8 bit characters */
  135.  
  136. /* Write register 4 */
  137. #define WR4_PARENABLE    0x01        /* Parity enable */
  138. #define WR4_PAREVEN    0x02        /* Even parity */
  139. #define WR4_STOP1    0x04        /* 1 stop bit */
  140. #define WR4_STOP15    0x08        /* 1.5 stop bits */
  141. #define WR4_STOP2    0x0C        /* 2 stop bits */
  142. #define WR4_SYNC8    0x00        /* 8 bit sync character */
  143. #define WR4_SYNC16    0x10        /* 16 bit sync character */
  144. #define WR4_SDLC    0x10        /* SDLC mode */
  145. #define WR4_EXTSYNC    0x30        /* External sync */
  146. #define WR4_X1CLOCK    0x00        /* x1 clock mode */
  147. #define WR4_X16CLOCK    0x40        /* x16 clock mode */
  148. #define WR4_X32CLOCK    0x80        /* x32 clock mode */
  149. #define WR4_X64CLOCK    0xC0        /* x64 clock mode */
  150.  
  151. /* Write register 5 */
  152. #define WR5_TXCRCENABLE    0x01        /* Enable CRC on Rx */
  153. #define WR5_RTS        0x02        /* RTS */
  154. #define WR5_CRC16    0x04        /* SDLC/CRC-16 */
  155. #define WR5_TXENABLE    0x08        /* Enable transmitter */
  156. #define WR5_BREAK    0x10        /* Send a break */
  157. #define WR5_TX5        0x00        /* Tx 5 bit characters */
  158. #define WR5_TX7        0x20        /* Tx 7 bit characters */
  159. #define WR5_TX6        0x40        /* Tx 6 bit characters */
  160. #define WR5_TX8        0x60        /* Tx 8 bit characters */
  161. #define WR5_DTR        0x80        /* DTR */
  162.  
  163. /* Write register 6 (Sync characters or SDLC address) */
  164.  
  165. /* Write register 7 more sync/SDLC */
  166.  
  167. /* Write register 8, same as data port, (Tx buffer) */
  168.  
  169. /* Write register 9 -- ONLY 1, SHARED BETWEEN CHANNELS, ACCESSABLE FROM BOTH */
  170. #define WR9_VIS        0x01        /* Vector Includes Status */
  171. #define WR9_NV        0x02        /* No Vector (don't respond to IACK) */
  172. #define WR9_DLC        0x04        /* Disable Lower Chain */
  173. #define WR9_MIE        0x08        /* Master Interrupt Enable */
  174. #define WR9_STATHIGH    0x10        /* Status high */
  175. #define WR9_RESETB    0x40        /* Reset channel B */
  176. #define WR9_RESETA    0x80        /* Reset channel A */
  177. #define WR9_RESETHARD    0xC0        /* Hardware reset */
  178.  
  179. /* Write register 10 */
  180. #define WR10_SYNC6    0x01        /* 6 bit sync */
  181. #define WR10_LOOP    0x02        /* Loop mode */
  182. #define WR10_ABORTUNDER    0x04        /* Abort on Underrun */
  183. #define WR10_MARKIDLE    0x08        /* Mark Idle */
  184. #define WR10_POLLACT    0x10        /* Go active on poll */
  185. #define WR10_NRZ    0x00        /* NRZ */
  186. #define WR10_NRZI    0x20        /* NRZI */
  187. #define WR10_FM1    0x40        /* FM (Transition = 1) */
  188. #define WR10_FM0    0x60        /* FM (Transition = 0) */
  189. #define WR10_PRESET1    0x80        /* CRC Preset 1 */
  190.  
  191. /* Write register 11 */
  192. #define WR11_XTAL    0x00        /* TRxC Out = XTAL Output */
  193. #define WR11_TXCLOCK    0x01        /* TRxC Out = Transmit clock */
  194. #define WR11_BRGEN    0x02        /* TRxC Out = BR Generator Output */
  195. #define WR11_DPLL    0x03        /* TRxC Out = DPLL Output */
  196. #define WR11_TRXCOUTEN    0x04        /* Enable TRxC as output */
  197. #define WR11_TXCLKRTXC    0x00        /* Tx clock = RTxC pin */
  198. #define WR11_TXCLKTRXC    0x08        /* Tx clock = TRxC pin */
  199. #define WR11_TXCLKBRGEN    0x10        /* Tx clock = BR Generator Output */
  200. #define WR11_TXCLKDPLL    0x18        /* Tx clock = DPLL Output */
  201. #define WR11_RXCLKRTXC    0x00        /* Rx clock = RTxC pin */
  202. #define WR11_RXCLKTRXC    0x20        /* Rx clock = TRxC pin */
  203. #define WR11_RXCLKBRGEN    0x40        /* Rx clock = BR Generator Output */
  204. #define WR11_RXCLKDPLL    0x60        /* Rx clock = DPLL Output */
  205. #define WR11_RTXCXTAL    0x80        /* Crystal RTxC in (else TTL) */
  206.  
  207. /* Read/Write register 12/13 Time constant */
  208.  
  209. /* Write register 14 */
  210. #define WR14_BRENABLE    0x01        /* BR Generator Enable */
  211. #define WR14_BRPCLK    0x02        /* BR Generator CLK from PCLK */
  212. #define WR14_DTRREQ    0x04        /* DTR low is DMA request */
  213. #define WR14_AUTOECHO    0x08        /* Auto echo */
  214. #define WR14_LOOPBACK    0x10        /* Local loopback */
  215. #define WR14_SEARCH    0x20        /* Enter Search mode */
  216. #define WR14_RESET    0x40        /* Reset Missing Clock */
  217. #define WR14_DPLLDISABLE 0x60        /* Disable DPLL */
  218. #define WR14_SRCBR    0x80        /* Set DPLL CLK Src = BR Generator */
  219. #define WR14_SRCRTXC    0xA0        /* Set DPLL CLK Src = RTxC */
  220. #define WR14_FM        0xC0        /* Set FM mode */
  221. #define WR14_NRZI    0xE0        /* Set NRZI mode */
  222.  
  223.